package com.http.method;

import java.io.File;
import java.net.HttpURLConnection;

/**
 * Created by mac_wk on 14-12-9.
 */
public class FileRequest extends Request<File> {
    //下载的长度
    private int start;
    private int end;
    private File file;
    private boolean pause = false;

    public FileRequest(String mUrl,File file) {
        super(mUrl);
        this.file = file;
        this.start = -1;
    }
    public FileRequest(String mUrl,File file,int start,int end)
    {
        super(mUrl);
        this.file = file;
        this.start = start;
        this.end = end;
        super.head.put("Range","bytes=" + start + "-" + end);
    }

    @Override
    public void setRequestType(String type) {

    }

    public boolean isPause() {
        return pause;
    }

    public void setPause(boolean pause) {
        this.pause = pause;
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    @Override
    public String getRequestType() {
        return null;
    }

    @Override
    public void executeRequest(HttpURLConnection httpURLConnection) {
    }

    @Override
    public int compareTo(Request<File> another) {
        return 0;
    }
}
